<!DOCTYPE html>


<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="jquery.min.js"></script>
</head>

<body>


    <script>
        let p = new promise((resolve, reject) => {
            $.ajax({
                utl: "/data/ablout.txt",
                type: "post",
                success: (arr) => {
                    resolve(arr);
                },
                error: (err) => {
                    reject(err);
                }
            });


            if (true) {
                resolve(arr) //请求成功 
            } else {
                reject(err) //请求失败 
            }
        }).then((arr) => {
            alert("请求成功");
            arr.forEach(item => {
                console.log(item)
            });
        }, (err) => {
            alert("请求失败")
        })

        console.log(promise);
    </script>


</body>

</html>